﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetCSharp
{
    public partial class FuxiType
    {
        void MakeFlopDecision()
        {
            _outs = HandEvaluator.GetNumberOuts(_frameData.Pocket, _frameData.Board);
            switch (strategy)
            {
                case Strategy.Basic:

                    if (winOdds > 0.90 ||
                    winOdds > 0.82 && _handData.NumFuxiRaisedFlop == 0 ||
                    _handData.HavePosition && _handData.NumOppRaisedFlop == 0 && winOdds > 0.54 ||
                    !_handData.HavePosition && _handData.NumOppRaisedFlop == 0 && winOdds > 0.68 ||
                    _handData.NumFuxiRaisedPreflop > 0 && shouldCbet && oppNeverRaised ||
                    _handData.NumFuxiRaisedPreflop == 0 && shouldBetFlop && oppNeverRaised
                    )
                    {
                        _handData.NumFuxiRaisedFlop++;
                        _flopCheckRaised = true;
                        ExecuteRaise();
                    }
                    else if (_handData.NumFuxiRaisedFlop == 0 && winOdds > 0.66 ||
                             _handData.NumFuxiRaisedFlop == 1 && winOdds > 0.70)
                    {
                        ExecuteCall();
                    }
                    else if (_outs > 7)
                    {
                        _handData.FuxiDrawing = true;
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                case Strategy.Trap:
                    if (winOdds > 0.6 && winOdds < 0.8 && _handData.NumOppRaisedFlop == 0)
                    {
                        _handData.NumFuxiRaisedFlop++;
                        _flopCheckRaised = true;
                        ExecuteRaise();
                    }
                    else if (winOdds > potOdds)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                default:
                    break;
            }
        }
    }
}
